import { Column, Entity, Index } from "typeorm";
import { DeletedEntity } from "./base/deleted.entity";

@Index("sys_menu_pkey", ["id"], { unique: true })
@Entity("sys_menu", { schema: "public" })
export class SysMenu extends DeletedEntity {
    @Column("bigint", { primary: true, name: "id" })
    id!: string;

    @Column("bigint", { name: "parent_id", nullable: true })
    parentId!: string | null;

    @Column("character varying", { name: "path", length: 256 })
    path!: string;

    @Column("character varying", { name: "name", nullable: true, length: 256 })
    name!: string | null;

    @Column("character varying", {
        name: "redirect",
        nullable: true,
        length: 256,
    })
    redirect!: string | null;

    @Column("character varying", {
        name: "component",
        nullable: true,
        length: 256,
    })
    component!: string | null;

    @Column("jsonb", { name: "meta", nullable: true })
    meta!: object | null;
}
